package com.erlang.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "customer")
public class CustomerController {

    /**
     * @Description 查看用户
     *  params:指定request中必须包含某些参数值，才让该方法处理
     */
    @RequestMapping(value = "findCustomerById", params = "id")
    public ModelAndView findCustomerById(String id){
       	ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("content",id);
        modelAndView.setViewName("argument");
        return modelAndView;
    }

    /**
     * @Description 查看用户
     */
    @RequestMapping(value = "findCustomerById1/{id}")
    public ModelAndView findCustomerById1(@PathVariable("id") String customerId){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("content",customerId);
        modelAndView.setViewName("argument");
        return modelAndView;
    }
}